#include<stdio.h>
#include<stdlib.h>
#include <SDL/SDL.h>
#include <SDL/SDL_image.h>
#include <time.h>
#include <math.h>
#include <SDL/SDL_ttf.h>
#include "constante.h"






void test_affichage (SDL_Surface *ecran)
{
   /****************************************************************************************************************************************/
    /************************DEFINITION DES VARIABLE DANS LA FONCTION */
    int continuer=1;
    int test_menu_principale=0;
    int continuer_profendeur_1=0;
    int i=0;
    int menu_choisi=0;

    SDL_Rect pos_ecran;
    pos_ecran.x = 0;
    pos_ecran.y = 0;
    SDL_Rect pos_menu;
    SDL_Event event;

    /************************DEFINITION DES VARIABLE DANS LA FONCTION */
/**********************************************************************************************************************************************/

    SDL_Surface *hello =SDL_LoadBMP("image\\hello.bmp");
    SDL_Surface *hello2=SDL_LoadBMP("image\\hello2.bmp");
    SDL_Surface *hello3=SDL_LoadBMP("image\\hello3.bmp");

    SDL_Surface *background=SDL_LoadBMP("image\\ecran.bmp");
    SDL_Surface *menu_neutre=SDL_LoadBMP("image\\menu_neutre.bmp");

    SDL_Surface *menu_demarrer=SDL_LoadBMP("image\\menu_demarrer.bmp");

    SDL_Surface *menu_reglage=SDL_LoadBMP("image\\menu_reglage.bmp");

    SDL_Surface *menu_score =SDL_LoadBMP("image\\menu_score.bmp");
    SDL_Surface *menu_aide=SDL_LoadBMP("image\\menu_aide.bmp");
    SDL_Surface *menu_quitter=SDL_LoadBMP("image\\menu_quitter.bmp");

    SDL_Surface *menu_demarrer_neutre=SDL_LoadBMP("image\\menu_demarrer_neutre.bmp");
    SDL_Surface *menu_demarrer_joueur_vs_pc =SDL_LoadBMP("image\\demarrer_joueur_vs_pc.bmp");
    SDL_Surface *menu_demarrer_multijoueurs=SDL_LoadBMP("image\\menu_demarrer_multijoueurs.bmp");

    SDL_Surface *menu_reglage_neutre=SDL_LoadBMP("image\\menu_reglage_neutre.bmp");
    SDL_Surface *menu_reglage_son=SDL_LoadBMP("image\\menu_reglage_son.bmp");
    SDL_Surface *menu_reglage_music=SDL_LoadBMP("image\\menu_reglage_music.bmp");
    SDL_Surface *menu_reglage_interface=SDL_LoadBMP("image\\menu_reglage_interface.bmp");



        /************************chargement des images */
        /*chargement des image de test de la fonction jouer vs joueur*/

    SDL_Surface *allumette= SDL_LoadBMP("image\\game\\allumette.bmp");

    SDL_Surface *game_space_1= SDL_LoadBMP("image\\game\\game_space_1.bmp");

    SDL_Surface *game_space_2= SDL_LoadBMP("image\\game\\game_space_2.bmp.bmp");

    SDL_Surface *range_0_allumette_0= SDL_LoadBMP("image\\game\\range_0_allumette_0.bmp");

    SDL_Surface *range_1= SDL_LoadBMP("image\\game\\range_1.bmp");

    SDL_Surface *range_1_allumette_0= SDL_LoadBMP("image\\game\\range_1_allumette_0.bmp");

    SDL_Surface *range_1_allumette_1= SDL_LoadBMP("image\\game\\range_1_allumette_1.bmp");

    SDL_Surface *range_1_allumette_2= SDL_LoadBMP("image\\game\\range_1_allumette_2.bmp");


    SDL_Surface *range_2= SDL_LoadBMP("image\\game\\range_2.bmp");

    SDL_Surface *range_2_allumette_0= SDL_LoadBMP("image\\game\\range_2_allumette_0.bmp");

    SDL_Surface *range_2_allumette_1= SDL_LoadBMP("image\\game\\range_2_allumette_1.bmp");

    SDL_Surface *range_2_allumette_2= SDL_LoadBMP("image\\game\\range_2_allumette_2.bmp");

    SDL_Surface *range_3= SDL_LoadBMP("image\\game\\range_3.bmp");

    SDL_Surface *range_3_allumette_0= SDL_LoadBMP("image\\game\\range_3_allumette_0.bmp");

    SDL_Surface *range_3_allumette_1= SDL_LoadBMP("image\\game\\range_3_allumette_1.bmp");

    SDL_Surface *range_3_allumette_2= SDL_LoadBMP("image\\game\\range_3_allumette_2.bmp");

    SDL_Surface *range_4= SDL_LoadBMP("image\\game\\range_4.bmp");

    SDL_Surface *range_4_allumette_0= SDL_LoadBMP("image\\game\\range_4_allumette_0.bmp");

    SDL_Surface *range_4_allumette_1= SDL_LoadBMP("image\\game\\range_4_allumette_1.bmp");

    SDL_Surface *range_4_allumette_2= SDL_LoadBMP("image\\game\\range_4_allumette_2.bmp");

    SDL_Surface *range_5= SDL_LoadBMP("image\\game\\range_5.bmp");

    SDL_Surface *range_5_allumette_0= SDL_LoadBMP("image\\game\\range_5_allumette_0.bmp");

    SDL_Surface *range_5_allumette_1= SDL_LoadBMP("image\\game\\range_5_allumette_1.bmp");

    SDL_Surface *range_5_allumette_2= SDL_LoadBMP("image\\game\\range_5_allumette_2.bmp");

    SDL_Surface *allumette_0= SDL_LoadBMP("image\\game\\allumette_0.bmp");
    SDL_Surface *allumette_1= SDL_LoadBMP("image\\game\\allumette_1.bmp");
    SDL_Surface *allumette_2= SDL_LoadBMP("image\\game\\allumette_2.bmp");









/************************************************************************************************************************************************/

    /*SDL_BlitSurface(hello, NULL, ecran, &pos_ecran);
    SDL_Flip(ecran);
    SDL_Delay(1000);
    SDL_BlitSurface(hello2, NULL, ecran, &pos_ecran);
    SDL_Flip(ecran);
    SDL_Delay(1000);
    SDL_BlitSurface(hello3, NULL, ecran, &pos_ecran);
    SDL_Flip(ecran);
    SDL_Delay(1000);
    SDL_BlitSurface(background, NULL, ecran, &pos_ecran);
    SDL_Flip(ecran);
    SDL_Delay(1000);
    SDL_BlitSurface(menu_neutre, NULL, ecran, &pos_ecran);
    SDL_Flip(ecran);
    SDL_Delay(1000);
    SDL_BlitSurface(menu_demarrer, NULL, ecran, &pos_ecran);
    SDL_Flip(ecran);
    SDL_Delay(1000);
    SDL_BlitSurface(menu_reglage, NULL, ecran, &pos_ecran);
    SDL_Flip(ecran);
    SDL_Delay(1000);
    SDL_BlitSurface(menu_score, NULL, ecran, &pos_ecran);
    SDL_Flip(ecran);
    SDL_Delay(1000);
    SDL_BlitSurface(menu_aide, NULL, ecran, &pos_ecran);
    SDL_Flip(ecran);
    SDL_Delay(1000);
    SDL_BlitSurface(menu_quitter, NULL, ecran, &pos_ecran);
    SDL_Flip(ecran);
    SDL_Delay(1000);
    SDL_BlitSurface(menu_demarrer_neutre, NULL, ecran, &pos_ecran);
    SDL_Flip(ecran);
    SDL_Delay(1000);
    SDL_BlitSurface(menu_demarrer_joueur_vs_pc, NULL, ecran, &pos_ecran);
    SDL_Flip(ecran);
    SDL_Delay(1000);
    SDL_BlitSurface(menu_demarrer_multijoueurs, NULL, ecran, &pos_ecran);
    SDL_Flip(ecran);
    SDL_Delay(1000);*/

  /*  SDL_BlitSurface(menu_reglage_neutre, NULL, ecran, &pos_ecran);
    SDL_Flip(ecran);
    SDL_Delay(1000);
    SDL_BlitSurface(menu_reglage_son, NULL, ecran, &pos_ecran);
    SDL_Flip(ecran);
    SDL_Delay(1000);
    SDL_BlitSurface(menu_reglage_music, NULL, ecran, &pos_ecran);
    SDL_Flip(ecran);
    SDL_Delay(1000);*/
    /*SDL_BlitSurface(menu_reglage_interface, NULL, ecran, &pos_ecran);
    SDL_Flip(ecran);
    SDL_Delay(1000);*/

/*
SDL_BlitSurface(allumette, NULL, ecran, &pos_ecran);
SDL_Flip(ecran);
SDL_Delay(test_time);

SDL_BlitSurface(game_space_1, NULL, ecran, &pos_ecran);

SDL_Flip(ecran);
SDL_Delay(test_time);

SDL_BlitSurface(game_space_2, NULL, ecran, &pos_ecran);

SDL_Flip(ecran);
SDL_Delay(test_time);

SDL_BlitSurface(range_0_allumette_0, NULL, ecran, &pos_ecran);
SDL_Flip(ecran);
SDL_Delay(test_time);

SDL_BlitSurface(range_1, NULL, ecran, &pos_ecran);
SDL_Flip(ecran);
SDL_Delay(test_time);

SDL_BlitSurface(range_1_allumette_0, NULL, ecran, &pos_ecran);
SDL_Flip(ecran);
SDL_Delay(test_time);

SDL_BlitSurface(range_1_allumette_1, NULL, ecran, &pos_ecran);
SDL_Flip(ecran);
SDL_Delay(test_time);

SDL_BlitSurface(range_1_allumette_2, NULL, ecran, &pos_ecran);
SDL_Flip(ecran);
SDL_Delay(test_time);


SDL_BlitSurface(range_2, NULL, ecran, &pos_ecran);
SDL_Flip(ecran);
SDL_Delay(test_time);

SDL_BlitSurface(range_2_allumette_0, NULL, ecran, &pos_ecran);
SDL_Flip(ecran);
SDL_Delay(test_time);


SDL_BlitSurface(range_2_allumette_1, NULL, ecran, &pos_ecran);
SDL_Flip(ecran);
SDL_Delay(test_time);

SDL_BlitSurface(range_2_allumette_2, NULL, ecran, &pos_ecran);
SDL_Flip(ecran);
SDL_Delay(test_time);


SDL_BlitSurface(range_3, NULL, ecran, &pos_ecran);
SDL_Flip(ecran);
SDL_Delay(test_time);

SDL_BlitSurface(range_3_allumette_0, NULL, ecran, &pos_ecran);
SDL_Flip(ecran);
SDL_Delay(test_time);


SDL_BlitSurface(range_3_allumette_1, NULL, ecran, &pos_ecran);
SDL_Flip(ecran);
SDL_Delay(test_time);

SDL_BlitSurface(range_3_allumette_2, NULL, ecran, &pos_ecran);
SDL_Flip(ecran);
SDL_Delay(test_time);

SDL_BlitSurface(range_4, NULL, ecran, &pos_ecran);
SDL_Flip(ecran);
SDL_Delay(test_time);
SDL_BlitSurface(range_4_allumette_0, NULL, ecran, &pos_ecran);
SDL_Flip(ecran);
SDL_Delay(test_time);
SDL_BlitSurface(range_4_allumette_1, NULL, ecran, &pos_ecran);
SDL_Flip(ecran);
SDL_Delay(test_time);
SDL_BlitSurface(range_4_allumette_2, NULL, ecran, &pos_ecran);
SDL_Flip(ecran);
SDL_Delay(test_time);
SDL_BlitSurface(range_5, NULL, ecran, &pos_ecran);
SDL_Flip(ecran);
SDL_Delay(test_time);
SDL_BlitSurface(range_5_allumette_0, NULL, ecran, &pos_ecran);
SDL_Flip(ecran);
SDL_Delay(test_time);
SDL_BlitSurface(range_5_allumette_1, NULL, ecran, &pos_ecran);
SDL_Flip(ecran);
SDL_Delay(test_time);
SDL_BlitSurface(range_5_allumette_2, NULL, ecran, &pos_ecran);
SDL_Flip(ecran);
SDL_Delay(test_time);
*/
SDL_BlitSurface(allumette_0, NULL, ecran, &pos_ecran);
SDL_Flip(ecran);
SDL_Delay(test_time);

SDL_BlitSurface(allumette_1, NULL, ecran, &pos_ecran);
SDL_Flip(ecran);
SDL_Delay(test_time);

SDL_BlitSurface(allumette_2, NULL, ecran, &pos_ecran);
SDL_Flip(ecran);
SDL_Delay(test_time);
}
